home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Subject: Re: Question on pointers
- Message-ID: <DpotxK.6MC@rci.ripco.com>
- X-Nntp-Sender: mambuhl@cook.ripco.com
- Sender: usenet@rci.ripco.com (Net News Admin)
- Organization: Ripco Internet BBS Chicago
- Date: Thu, 11 Apr 1996 07:53:44 GMT
-
- ebromber@forest.drew.edu in <1996Apr8.233330.139449@forest> asks:
-
- >In a program there is an array of structs. One of the headers for a
- >function says void pop(stack *).
- ^^
- Should be ';'
-
- >My question is shouldn't there be a name
- >or identifier after the asterisk?
-
- No. This is a prototype telling the compiler that pop is a
- function taking an argument of type `stack *' and returning
- nothing.
-
- >My friend says that it is the address of
- >a stack in the array.
-
- This is meaningless.
-
- >If this is true, how could I access the thing
- >pointed to?
-
- By dereferencing the pointer.
-
- >Here are some lines which define a stack
-
- >typedef struct item item;
- >struct item {
- > struct item *next;
- > char c;
- > }
- ^^^
- missing ';'
- >typedef item *stack;
-
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-